import axios from 'axios'

export const GET_DETAIL_DATA = 'GET_DETAIL_DATA'
export const getDetailAction = (id) => {
  return dispatch => {
    axios.get('/api/detail.json?id=' + id).then(res => {
      let result = res.data.data
      dispatch({
        type: GET_DETAIL_DATA,
        title: result.title,
        content: result.content
      })
    })
  }
}
